import { BrowserRouter ,Route, Routes } from 'react-router-dom'
import { lazy, Suspense } from 'react'
import Layout from '@/Layout/Layout'
const Login = lazy(()=>import('@/views/login/Login'))
const Index = lazy(() => import('@/views/index/Index'))
const Love  = lazy(()=>import('@/views/love/Love'))
const Link = lazy(()=>import('@/views/link/Link'))
const Whisper = lazy(()=>import('@/views/whisper/Whisper'))
const ArticleList = lazy(()=>import('@/views/article/ArticleList/ArticleList'))
const Article  = lazy(()=>import('@/views/article/Article'))
const Router = () => {
    return (
        <BrowserRouter>
            <Suspense>
                <Routes>
                    <Route path='/' element={<Layout/>}>
                        <Route path="/" element={<Index/>}></Route>
                        <Route path="/love" element={<Love/>}></Route>
                        <Route path="/link" element={<Link/>}></Route>
                        <Route path="/whisper" element={<Whisper/>}></Route>
                        <Route path="/list" element={<ArticleList/>}></Route>
                        <Route path="/login" element={<Login/>}></Route>
                        <Route path="/article" element={<Article/>}></Route>
                    </Route>
                </Routes>
            </Suspense>
        </BrowserRouter>
    )
}
 
export default Router
